package com.sofwin.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sofwin.mapper.DIpotellcodeMapper;
import com.sofwin.pojo.DIpotellcode;
import com.sofwin.pojo.DIpotellcodeExample;
import com.sofwin.pojo.DIpotellcodeWithBLOBs;
import com.sofwin.service.DIpotellcodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Project: ssm-parent
 * @Description: TODO
 * @Author : abiao
 * @date Date : 2021年04月23日 下午 6:34
 */
@Service
public class DIpotellcodeServiceImpl implements DIpotellcodeService {

    @Autowired
    private DIpotellcodeMapper dIpotellcodeMapper;

    @Override
    public PageInfo<DIpotellcodeWithBLOBs> selectModel(DIpotellcodeWithBLOBs dIpotellcodeWithBLOBs,Integer pageNumber, Integer pageSize) {
        DIpotellcodeExample example = new DIpotellcodeExample();
        DIpotellcodeExample.Criteria criteria = example.createCriteria();
        PageHelper.startPage(pageNumber,pageSize);
        if (dIpotellcodeWithBLOBs.getModelName() != null && dIpotellcodeWithBLOBs.getModelName() != ""){
            criteria.andModelNameLike("%"+dIpotellcodeWithBLOBs.getModelName()+"%");
        }
        List<DIpotellcodeWithBLOBs> WithBLOBs = dIpotellcodeMapper.selectByExampleWithBLOBs(example);
        System.out.println(WithBLOBs.toString());
        return new PageInfo<DIpotellcodeWithBLOBs>(WithBLOBs);
    }
}
